package cn.tedu.system.order.mapper;

import cn.tedu.system.order.pojo.dto.OrderPageDto;
import cn.tedu.system.order.pojo.dto.OrderReviseDto;
import cn.tedu.system.order.pojo.dto.OrderSelDto;
import cn.tedu.system.order.pojo.dto.OrderStockParam;
import cn.tedu.system.order.pojo.entity.Order;
import cn.tedu.system.order.pojo.entity.OrderItem;
import cn.tedu.system.order.pojo.vo.OrderItemVO;
import cn.tedu.system.order.pojo.vo.OrderVO;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper {
    //创建订单
    int create(Order order);
    //获取订单id
    Long getOrderId(String orderNo);
    //创建订单商品
    int addOrderItems(List<OrderItem> orderItems);
    //修改订单
    int reviseOrder(Order order);
    //删除订单
    int deleteOrder(OrderReviseDto orderReviseDto);
    //查看订单
    List<OrderVO> selectOrder(OrderSelDto orderSelDto);
    //查看所有订单
    List<OrderVO> selectAllOrder(Long userId);

    //查询商品价格
    Double selectPrice(Long productId);
    //获取商家id
    Long getMerchantId(Long productId);

    //商家发货功能
    int shipment(Order order);
    //查询商品库存
    Integer getStocks(Long productId);
    //订单生成修改库存
    int reduceStocks(OrderStockParam orderStock);
    //查订单总数
    int selectOrderCount(Long userId);
    //查看订单详情
    List<OrderItemVO> selDetail(Long orderId);

    //商家查看订单 杨平
    List<OrderVO> getOrders(Long merchantId);

    //查询直播商品库存
    Integer getLiveStocks(Long productId);
    //修改直播商品库存
    int reduceLiveStocks(OrderStockParam orderStock);
}
